package com.headwind.logistics.system.service.impl;

import com.headwind.logistics.system.dto.IntegralMallDetailDto;
import com.headwind.logistics.system.mapper.IntegralMallMapper;
import com.headwind.logistics.system.pojo.IntegralMall;
import com.headwind.logistics.system.service.intl.IntegralMallService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author你爸爸 Date2020/7/27 15:07
 * Version 1.0
 * DESCRIPTION
 */
@Service
public class IntegralMallServiceImpl implements IntegralMallService {
    @Autowired
    private IntegralMallMapper integralMallMapper;

    @Override
    public List<IntegralMall> selectIntegralMall(Integer page, Integer rows) {
        if (page != null){
            page = (page-1)*rows;
        }
        return integralMallMapper.selectIntegralMall(page,rows);
    }

    @Override
    public List<IntegralMallDetailDto> selectIntegralMallDetail(Integer page, Integer rows,@Param("integralMallId")Integer integralMallId) {
        if (page != null){
            page = (page-1)*rows;
        }
        return integralMallMapper.selectIntegralMallDetail(page,rows,integralMallId);
    }

    @Override
    public int insertIntegralMallDetail(IntegralMall integralMall) {
        return integralMallMapper.insertIntegralMallDetail(integralMall);
    }

    @Override
    public int deleteIntegralMall(Long integralMallId) {
        return integralMallMapper.deleteIntegralMall(integralMallId);
    }

}
